local HurtStrategy = class("HurtStrategy")

function HurtStrategy:ctor(config, skill)
    self._config = config
    self._skill = skill
end

-- 定义算法逻辑顺序
function HurtStrategy:doStrategy(target)
    local hurt = self:hurt(target)
    return hurt
end

function HurtStrategy:_critHurt(hurt)
    local AttributeConst = require("const.AttributeConst")
    local entity = self._skill:getEntity()
    local result = hurt
    local isCrit = false
    local crit = entity:getAttrValue(AttributeConst.CRIT)
    local crit_hurt = entity:getAttrValue(AttributeConst.CRIT_HURT)
    local pro = math.random(1, 1000)
    if pro <= crit then
        result = result + hurt * (0.5 + crit_hurt / 1000)
        isCrit = true
    end
    return result, isCrit
end

-- 一些特殊伤害策略
function HurtStrategy:specialStrategy(hurt)
end

return HurtStrategy
